25 26 27 28 29 30
Here is the program, with comments in terms of the range of integers printed:
' Loop with a loop condition ' LET NUM = 25 'First Value ' DO WHILE NUM <= 30 'next two statements execute if NUM is less than or equal to 30 PRINT NUM LET NUM = NUM + 1 'increase NUM by one LOOP END
The computer does not care what value you start with. You can use a negative value to start, and increase it until it reaches a positive value. Here is a program that does that:
' Loop with a loop condition ' LET NUM = -3 'First Value DO WHILE NUM <= 2 'next two statements execute if NUM is less than or equal to 2 PRINT NUM LET NUM = NUM + 1 'increase NUM by one LOOP END
What will this new program print on the monitor screen?